from django.forms import forms
import datetime
from decimal import Decimal
from StartGroup.models import Group
        
class Category( forms.Form ):
    category = forms.CharField( max_length = 200, default = 'Unspecified', db_index=True )
    description = forms.CharField( max_length = 200, default = 'Unspecified' )
    isActive = forms.BooleanField(default=1)
    parents = forms.ManyToManyField('self', symmetrical=False, blank=True, null=True)
    
    def __unicode__(self):
        return self.category
    

class Transaction( models.Model ):
    group_web_address = models.ForeignKey(Group, to_field='group_web_address')
    date = models.DateTimeField( 'Transaction Date', auto_now=False, db_index=True )
    description = models.CharField( max_length = 200, default = 'Unspecified' )
    category = models.ForeignKey(Category, unique = False)
    amount = models.DecimalField(decimal_places=2, max_digits = 11, null=True, blank=True)
    comment = models.CharField( max_length = 200, null=True, blank=True )
    
    def __unicode__( self ):
        return self.transactionDescription
    
    #!/usr/bin/env python

